﻿package edu.chds.utils
{
	import edu.chds.data.XMLLoad;
	import edu.chds.ui.Timeline;
	
	public class TimelineLoader
	{
		public var xmlPath:String;
		public var timeline:Timeline;
		private var xml:XMLLoad;
		private var xmlList:XMLList;
		private var initialized:Boolean = false;
		private var typeArray:Array;
		
		public function TimelineLoader(path:String, hsTimeline:Timeline)
		{
			xmlPath = path;
			timeline = hsTimeline;
			
			xml = new XMLLoad(xmlPath, timeline);
		}
//		public function load(
		public function XMLParsed(xList:XMLList):void {
			xmlList = xList;
			
			if (!initialized) {
				trace( xmlList.type );
//				getArrayFromXML(xmlList);
				initialized = true;
			}
//			timeline.cbType. 
		}
//		Having troubles with pushing XML data in array. Maybe might not need to use array
		public function getArrayFromXML(xList:XMLList):void {
			var tempList:XMLList = xList;
			var origonalArray:Array;
			
			for each(var word:String in tempList) {
				origonalArray.push(word);
			}
			trace("origonalArray : " + origonalArray);
		}
	}
}